home *** CD-ROM | disk | FTP | other *** search
- import javax.microedition.lcdui.Command;
- import javax.microedition.lcdui.CommandListener;
- import javax.microedition.lcdui.Display;
- import javax.microedition.lcdui.Displayable;
- import javax.microedition.lcdui.Form;
-
- public class Properties implements CommandListener {
- private Form props;
- private StringBuffer propbuf;
- private Command backCommand = new Command("Back", 2, 1);
- private ChessDisplayable back;
-
- public Properties(ChessDisplayable var1) {
- this.back = var1;
- this.propbuf = new StringBuffer(50);
- this.props = new Form("System Properties");
- }
-
- public void commandAction(Command var1, Displayable var2) {
- if (var1 == this.backCommand) {
- this.back.makeCurrent(CU.getDisplay());
- }
-
- }
-
- public void makeCurrent(Display var1) {
- Runtime var2 = Runtime.getRuntime();
- var2.gc();
- long var3 = var2.freeMemory();
- long var5 = var2.totalMemory();
- this.props.append("Free Memory = " + var3 + "\n");
- this.props.append("Total Memory = " + var5 + "\n");
- this.props.append(this.showProp("microedition.configuration"));
- this.props.append(this.showProp("microedition.profiles"));
- this.props.append(this.showProp("microedition.platform"));
- this.props.append(this.showProp("microedition.locale"));
- this.props.append(this.showProp("microedition.encoding"));
- this.props.append(this.showProp("microedition.encodingClass"));
- this.props.append(this.showProp("microedition.http_proxy"));
- this.props.addCommand(this.backCommand);
- this.props.setCommandListener(this);
- var1.setCurrent(this.props);
- }
-
- String showProp(String var1) {
- String var2 = System.getProperty(var1);
- this.propbuf.setLength(0);
- this.propbuf.append(var1);
- this.propbuf.append(" = ");
- if (var2 == null) {
- this.propbuf.append("<undefined>");
- } else {
- this.propbuf.append("\"");
- this.propbuf.append(var2);
- this.propbuf.append("\"");
- }
-
- this.propbuf.append("\n");
- return this.propbuf.toString();
- }
- }
-